package com.chendx.article.feign;

import com.chendx.model.behavior.dtos.BehaviorEntryDto;
import com.chendx.model.behavior.pojos.ApBehaviorEntry;
import com.chendx.model.behavior.pojos.ApLikesBehavior;
import com.chendx.model.behavior.pojos.ApUnlikesBehavior;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by chendx on 2022/3/8.
 */
@FeignClient("leadnews-behavior")
public interface BehaviorFeign {

    @PostMapping("/api/v1/behavior_entry")
    public ApBehaviorEntry findByUserIdOrEquipmentId(@RequestBody BehaviorEntryDto dto);


    @GetMapping("/api/v1/un_likes_behavior/one")
    ApUnlikesBehavior findUnLikeByArticleIdAndEntryId(@RequestParam("entryId") Integer entryId,
                                                      @RequestParam("articleId") Long articleId);

    @GetMapping("/api/v1/like_behavior/one")
    ApLikesBehavior findLikeByArticleIdAndEntryId(
            @RequestParam("articleId") Long articleId,
            @RequestParam("entryId") Integer entryId,
            @RequestParam("type") short type);
}
